package com.fds.app.comm.service.impl;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import com.fds.app.cm.dto.CodeCurrencyDto;
import com.fds.app.cm.service.CodeCurrencyService;
import com.fds.app.comm.context.Combuf;
import com.fds.app.comm.service.NvPreProcessor;
import com.fds.app.comm.util.BeanDebugUtil;

@Component
@Order(value = 5)
public class NvPreCodeCurrencyInitProcessor implements NvPreProcessor {
	Logger logger = LoggerFactory.getLogger(this.getClass());
	
	@Autowired
	private Combuf combuf;
	
	@Autowired
	private CodeCurrencyService codeCurrencyService;
	
	@Override
	public void init() {
		combuf.showCombufStatus();
	}

	@Override
	public void process() {
		
		CodeCurrencyDto codeCurrencyDto = codeCurrencyService.forBuilder(combuf);
		
		BeanDebugUtil.showBeanInfo(codeCurrencyDto);
		
		combuf.setCodeCurrencyDto(codeCurrencyDto);
		
	}

	@Override
	public void finish() {

	}

}
